package com.atguigu.yygh.hosp.testmongo;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName UserRepository
 * @Description 此类描述:
 * @Author dangchen
 * @DateTime 2022-10-10 11:34
 * @Version 1.0
 */
@Repository
public interface UserRepository extends MongoRepository<User,String> {
    //name=?
    public List<User> findByName(String name);

    //name like ?
    public List<User> findByNameLike(String name);

    //name =? and age =?
    public List<User> findByNameAndAge(String name,Integer age);

    //name like ? and age >?
    public List<User> findByNameLikeAndAgeGreaterThan(String name,Integer age);
}
